package com.da.demo.utils;

import com.da.demo.security.entity.DailyUsers;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * @Author: hyacinth
 * @CreateTime: 2025-02-25
 * @Version: 1.0
 */

public class LoginInfoUtil {

    /**
     * 获取当前登录人的信息
     *
     * @return
     */
    public static DailyUsers getCurrentLoginUser() {
        return (DailyUsers) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }
}
